import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import axios from 'axios'
import Vuex from 'vuex'
import infiniteScroll from 'vue-infinite-scroll'
axios.interceptors.response.use(
	response => {
		//拦截响应，做统一处理 
		return response
	},
	//接口错误状态处理，也就是说无响应时的处理
	error => {
		return Promise.reject(error.response) // 返回接口返回的错误信息
	})
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'

Vue.use(Vuex)
Vue.use(ElementUI)
Vue.use(infiniteScroll)
Vue.config.devtools = true;
Vue.config.productionTip = false
Vue.prototype.$axios = axios
router.afterEach((to, from, next) => {
	window.scrollTo(0, 0);
})

new Vue({
	router,
	store,
	render: h => h(App)
}).$mount('#app')
